/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * supervision_tareas_edita.java
 *
 * Created on 16/04/2011, 01:22:43 PM
 */

package sie_invdis;


import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;

/**
 *
 * @author Michelle
 */
public class supervision_tareas_edita extends javax.swing.JDialog {
 
     private JTable jtable_tiendas;
     private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
     private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
     bd_conexion x = new bd_conexion() ;
       //se creaa la variable resultset
     ResultSet rs = null;
    int controlcombo=0;
    int controlcombo_grupo=0;
    String ffolio="";
    /** Creates new form supervision_tareas_edita */
    public supervision_tareas_edita(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    public supervision_tareas_edita(java.awt.Frame parent, boolean modal, int folio) {
        super(parent, modal);

        initComponents();
       // x.estableceConexion();
        ffolio=String.valueOf(folio);
        this.cargar_datoscata_tareas(ffolio);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jtf_horarealiza = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jtf_asignado = new javax.swing.JTextField();
        jtf_fecha = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jtf_tipo = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jtf_prioridad = new javax.swing.JTextField();
        jScrollPane5 = new javax.swing.JScrollPane();
        jep_imagenenvia = new javax.swing.JEditorPane();
        jbtn_enproceso = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jta_descripcion = new javax.swing.JEditorPane();
        cmbx_fotosorigen = new javax.swing.JComboBox();
        jcmbx_imagenestarea = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jbtn_guardar = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jft_fecharealizada = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jtf_horarealizada = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jtf_calificacion = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jta_personal = new javax.swing.JEditorPane();
        jScrollPane3 = new javax.swing.JScrollPane();
        jta_comentarios = new javax.swing.JEditorPane();
        jlbl_calificar = new javax.swing.JLabel();
        jcmbx_calificar = new javax.swing.JComboBox();
        jcmbx_otras = new javax.swing.JComboBox();
        jlbl_otros = new javax.swing.JLabel();
        jtf_grupotareas = new javax.swing.JTextField();
        jScrollPane6 = new javax.swing.JScrollPane();
        jep_comentarios = new javax.swing.JEditorPane();
        jbtn_agregarcomentario = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jep_respuestas = new javax.swing.JEditorPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_guardar = new javax.swing.JMenuItem();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_escape = new javax.swing.JMenuItem();
        jmni_actualizar = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(supervision_tareas_edita.class);
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jtf_horarealiza.setEditable(false);
        jtf_horarealiza.setToolTipText(resourceMap.getString("jtf_horarealiza.toolTipText")); // NOI18N
        jtf_horarealiza.setName("jtf_horarealiza"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jtf_asignado.setEditable(false);
        jtf_asignado.setText(resourceMap.getString("jtf_asignado.text")); // NOI18N
        jtf_asignado.setName("jtf_asignado"); // NOI18N

        jtf_fecha.setEditable(false);
        jtf_fecha.setText(resourceMap.getString("jtf_fecha.text")); // NOI18N
        jtf_fecha.setName("jtf_fecha"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jtf_tipo.setEditable(false);
        jtf_tipo.setText(resourceMap.getString("jtf_tipo.text")); // NOI18N
        jtf_tipo.setName("jtf_tipo"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jtf_prioridad.setEditable(false);
        jtf_prioridad.setText(resourceMap.getString("jtf_prioridad.text")); // NOI18N
        jtf_prioridad.setName("jtf_prioridad"); // NOI18N

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        jep_imagenenvia.setContentType(resourceMap.getString("jep_imagenenvia.contentType")); // NOI18N
        jep_imagenenvia.setEditable(false);
        jep_imagenenvia.setName("jep_imagenenvia"); // NOI18N
        jScrollPane5.setViewportView(jep_imagenenvia);

        jbtn_enproceso.setText(resourceMap.getString("jbtn_enproceso.text")); // NOI18N
        jbtn_enproceso.setToolTipText(resourceMap.getString("jbtn_enproceso.toolTipText")); // NOI18N
        jbtn_enproceso.setName("jbtn_enproceso"); // NOI18N
        jbtn_enproceso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_enprocesoActionPerformed(evt);
            }
        });

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jta_descripcion.setContentType(resourceMap.getString("jta_descripcion.contentType")); // NOI18N
        jta_descripcion.setEditable(false);
        jta_descripcion.setName("jta_descripcion"); // NOI18N
        jScrollPane2.setViewportView(jta_descripcion);

        cmbx_fotosorigen.setToolTipText(resourceMap.getString("cmbx_fotosorigen.toolTipText")); // NOI18N
        cmbx_fotosorigen.setName("cmbx_fotosorigen"); // NOI18N
        cmbx_fotosorigen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbx_fotosorigenActionPerformed(evt);
            }
        });

        jcmbx_imagenestarea.setToolTipText(resourceMap.getString("jcmbx_imagenestarea.toolTipText")); // NOI18N
        jcmbx_imagenestarea.setName("jcmbx_imagenestarea"); // NOI18N
        jcmbx_imagenestarea.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcmbx_imagenestareaActionPerformed(evt);
            }
        });

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_asignado, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_fecha, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_horarealiza, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_tipo, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_prioridad, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jbtn_enproceso))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmbx_fotosorigen, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jcmbx_imagenestarea, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addComponent(jtf_asignado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jtf_horarealiza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jtf_tipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jtf_prioridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(cmbx_fotosorigen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(jcmbx_imagenestarea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbtn_enproceso)
                .addContainerGap())
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jbtn_guardar.setIcon(resourceMap.getIcon("jbtn_guardar.icon")); // NOI18N
        jbtn_guardar.setText(resourceMap.getString("jbtn_guardar.text")); // NOI18N
        jbtn_guardar.setName("jbtn_guardar"); // NOI18N
        jbtn_guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_guardarActionPerformed(evt);
            }
        });

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jft_fecharealizada.setEditable(false);
        jft_fecharealizada.setText(resourceMap.getString("jft_fecharealizada.text")); // NOI18N
        jft_fecharealizada.setName("jft_fecharealizada"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jtf_horarealizada.setText(resourceMap.getString("jtf_horarealizada.text")); // NOI18N
        jtf_horarealizada.setName("jtf_horarealizada"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jtf_calificacion.setEditable(false);
        jtf_calificacion.setText(resourceMap.getString("jtf_calificacion.text")); // NOI18N
        jtf_calificacion.setName("jtf_calificacion"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jta_personal.setName("jta_personal"); // NOI18N
        jScrollPane1.setViewportView(jta_personal);

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jta_comentarios.setToolTipText(resourceMap.getString("jta_comentarios.toolTipText")); // NOI18N
        jta_comentarios.setName("jta_comentarios"); // NOI18N
        jScrollPane3.setViewportView(jta_comentarios);

        jlbl_calificar.setText(resourceMap.getString("jlbl_calificar.text")); // NOI18N
        jlbl_calificar.setName("jlbl_calificar"); // NOI18N

        jcmbx_calificar.setName("jcmbx_calificar"); // NOI18N
        jcmbx_calificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcmbx_calificarActionPerformed(evt);
            }
        });

        jcmbx_otras.setName("jcmbx_otras"); // NOI18N
        jcmbx_otras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcmbx_otrasActionPerformed(evt);
            }
        });

        jlbl_otros.setText(resourceMap.getString("jlbl_otros.text")); // NOI18N
        jlbl_otros.setName("jlbl_otros"); // NOI18N

        jtf_grupotareas.setEditable(false);
        jtf_grupotareas.setText(resourceMap.getString("jtf_grupotareas.text")); // NOI18N
        jtf_grupotareas.setName("jtf_grupotareas"); // NOI18N

        jScrollPane6.setName("jScrollPane6"); // NOI18N

        jep_comentarios.setContentType(resourceMap.getString("jep_comentarios.contentType")); // NOI18N
        jep_comentarios.setEditable(false);
        jep_comentarios.setName("jep_comentarios"); // NOI18N
        jScrollPane6.setViewportView(jep_comentarios);

        jbtn_agregarcomentario.setIcon(resourceMap.getIcon("jbtn_agregarcomentario.icon")); // NOI18N
        jbtn_agregarcomentario.setText(resourceMap.getString("jbtn_agregarcomentario.text")); // NOI18N
        jbtn_agregarcomentario.setName("jbtn_agregarcomentario"); // NOI18N
        jbtn_agregarcomentario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_agregarcomentarioActionPerformed(evt);
            }
        });

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jScrollPane7.setName("jScrollPane7"); // NOI18N

        jep_respuestas.setContentType(resourceMap.getString("jep_respuestas.contentType")); // NOI18N
        jep_respuestas.setEditable(false);
        jep_respuestas.setName("jep_respuestas"); // NOI18N
        jScrollPane7.setViewportView(jep_respuestas);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                            .addComponent(jlbl_otros)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jcmbx_otras, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(jtf_grupotareas, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jbtn_agregarcomentario)
                            .addGap(88, 88, 88)
                            .addComponent(jLabel12)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jtf_calificacion, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jlbl_calificar)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jcmbx_calificar, 0, 78, Short.MAX_VALUE))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel7)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jft_fecharealizada, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 97, Short.MAX_VALUE)
                            .addComponent(jLabel8)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtf_horarealizada, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel9)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(jLabel10, 0, 0, Short.MAX_VALUE))
                                .addComponent(jbtn_guardar, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)
                                .addComponent(jScrollPane1))))
                    .addComponent(jLabel11))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(jft_fecharealizada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8)
                            .addComponent(jtf_horarealizada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(30, 30, 30)
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap(109, Short.MAX_VALUE)
                        .addComponent(jbtn_guardar)
                        .addGap(280, 280, 280)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(jtf_calificacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jcmbx_calificar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jlbl_calificar))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jbtn_agregarcomentario)
                        .addGap(19, 19, 19)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlbl_otros)
                    .addComponent(jcmbx_otras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_grupotareas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_guardar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.ALT_MASK));
        jmni_guardar.setIcon(resourceMap.getIcon("jmni_guardar.icon")); // NOI18N
        jmni_guardar.setText(resourceMap.getString("jmni_guardar.text")); // NOI18N
        jmni_guardar.setName("jmni_guardar"); // NOI18N
        jmni_guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_guardarActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_guardar);

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jmni_actualizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, 0));
        jmni_actualizar.setIcon(resourceMap.getIcon("jmni_actualizar.icon")); // NOI18N
        jmni_actualizar.setText(resourceMap.getString("jmni_actualizar.text")); // NOI18N
        jmni_actualizar.setName("jmni_actualizar"); // NOI18N
        jmni_actualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_actualizarActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_actualizar);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtn_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
            this.terminartarea();
        } else {
            //this.jtf_clave.requestFocus();
        }
    }//GEN-LAST:event_jbtn_guardarActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
       if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
        {
            this.dispose();
        }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jbtn_enprocesoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_enprocesoActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea Marcar Esta Tarea en Proceso?")==0) {
          this.tareaenproceso();
          this.jbtn_enproceso.setVisible(false);
        } else {
            //this.jtf_clave.requestFocus();
        }
    }//GEN-LAST:event_jbtn_enprocesoActionPerformed

    private void jmni_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_guardarActionPerformed
        // TODO add your handling code here:
        this.jbtn_guardarActionPerformed(evt);
    }//GEN-LAST:event_jmni_guardarActionPerformed

    private void jcmbx_imagenestareaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmbx_imagenestareaActionPerformed
        // TODO add your handling code here:
         //this.jep_imagenestrabajo.setText("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://michelleptv.dyndns.org/javaweb/super_tareasrespuesta/"+this.jcmbx_imagenestarea.getSelectedItem().toString()+"\" width=\"445\" height=\"365\" border=\"0\" alt=\"Foto\"></img></p></body></html>");
        this.jep_imagenenvia.setText("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHost()+"/javaweb/super_tareasrespuesta/"+this.jcmbx_imagenestarea.getSelectedItem().toString()+"\" width=\"445\" height=\"365\" border=\"0\" alt=\"Foto\"></img></p></body></html>");
    }//GEN-LAST:event_jcmbx_imagenestareaActionPerformed

    private void jcmbx_calificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmbx_calificarActionPerformed
        // TODO add your handling code here:
       if(controlcombo==1)
           {
           if(JOptionPane.showConfirmDialog(null, "Desea Calificar?")==0) {
                this.tareacalificar();
            }
            
           }
        

    }//GEN-LAST:event_jcmbx_calificarActionPerformed

    private void jbtn_agregarcomentarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_agregarcomentarioActionPerformed
        // TODO add your handling code here:
        String jcomentario=JOptionPane.showInputDialog("Ingresa Tu comentario u observacion:");
                        if (jcomentario.length() > 0)
                            {
                                this.tareaaddcomentario(jcomentario);
                                this.jep_comentarios.setText(this.jep_comentarios.getText()+" "+jcomentario);
                            }
}//GEN-LAST:event_jbtn_agregarcomentarioActionPerformed

    private void jcmbx_otrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmbx_otrasActionPerformed
        // TODO add your handling code here:
          if(controlcombo_grupo==1)
           {
            if(JOptionPane.showConfirmDialog(null, "Desea Ver esta Tarea?")==0) {
                this.cargar_datoscata_t_grupo("");
            }

           }
    }//GEN-LAST:event_jcmbx_otrasActionPerformed

    private void cmbx_fotosorigenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbx_fotosorigenActionPerformed
        // TODO add your handling code here:
        this.jep_imagenenvia.setText("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHost()+"/javaweb/super_tareaasigna/"+this.cmbx_fotosorigen.getSelectedItem().toString()+"\" width=\"445\" height=\"365\" border=\"0\" alt=\"Foto\"></img></p></body></html>");
    }//GEN-LAST:event_cmbx_fotosorigenActionPerformed

    private void jmni_actualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_actualizarActionPerformed
        // TODO add your handling code here:
         this.cargar_datoscata_tareas(ffolio);
    }//GEN-LAST:event_jmni_actualizarActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
}//GEN-LAST:event_jmni_escapeActionPerformed
private void terminartarea(){

        String arreglo_folio[]=this.jtf_tipo.getText().split(":");
       String alias=variables_global.getLogin().substring(0, 4);
        String texto="";
        String descrip=alias.toUpperCase()+":"+this.jta_comentarios.getText().replace("\n", " ")+"<br>";
        String descripper=this.jta_personal.getText().replace("\n", " ");
        String confirma="";
        texto="select * from x1_supervision_tareas_actualiza(1,"+Integer.valueOf(arreglo_folio[0])+",'"+descrip.toUpperCase()+"','"+descripper.toUpperCase()+"','','"+this.jtf_horarealizada.getText().toUpperCase()+"',0,0,'','','');";
        System.out.println(texto);
          
            try
            {
                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                
               while (rs.next())
                    {
                      confirma=rs.getString(1);
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         if (confirma.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias tu Respuesta", "Sistema Integral Tareas",1);

              }
         else
              {
                JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);

              }
       
         
    }
private void tareaenproceso(){

        String arreglo_folio[]=this.jtf_tipo.getText().split(":");

        String texto="",confirma="";
        texto="select * from x1_supervision_tareas_actualiza(2,"+Integer.valueOf(arreglo_folio[0])+",'','','','',0,0,'','','');";
        System.out.println(texto);

            try
            {
                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());

               while (rs.next())
                    {
                      confirma=rs.getString(1);
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         if (confirma.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias se Marco en Proceso", "Sistema Integral Tareas",1);

              }
         else
              {
                JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);

              }


    }
private void tareacalificar(){

        String arreglo_folio[]=this.jtf_tipo.getText().split(":");
        String arreglo_califica[]=this.jcmbx_calificar.getSelectedItem().toString().split(":");
        String texto="",confirma="";
        texto="select * from x1_supervision_tareas_actualiza(3,"+Integer.valueOf(arreglo_folio[0])+",'','','','',"+Integer.valueOf(arreglo_califica[0])+",0,'','','');";
        System.out.println(texto);

            try
            {
                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());

               while (rs.next())
                    {
                      confirma=rs.getString(1);
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         if (confirma.equals("1"))
              {
                
                JOptionPane.showMessageDialog(null,"Gracias Tarea Calificada", "Sistema Integral Tareas",1);
                this.jlbl_calificar.setVisible(false);
                this.jcmbx_calificar.setVisible(false);
                this.jtf_calificacion.setText(this.jcmbx_calificar.getSelectedItem().toString());
              }
         else
              {
                JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);

              }


    }

private void tareaaddcomentario(String comentario){

        String arreglo_folio[]=this.jtf_tipo.getText().split(":");
         String alias=variables_global.getLogin().substring(0, 4)+":";
        String texto="",confirma="";
        texto="select * from x1_supervision_tareas_actualiza(4,"+Integer.valueOf(arreglo_folio[0])+",'','','','',0,0,'"+alias.toUpperCase()+comentario.toUpperCase()+"<br>"+"','','');";
        System.out.println(texto);

            try
            {
                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());

               while (rs.next())
                    {
                      confirma=rs.getString(1);
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         if (confirma.equals("1"))
              {

                JOptionPane.showMessageDialog(null,"Gracias por tu Comentario", "Sistema Integral Tareas",1);


              }
         else
              {
                JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);

              }


    }


private void cargar_datoscata_tareas(String texbuesqueda)
{
     
            String texto="",texto2="";
            java.util.Date fechainicial=new Date();
            ResultSet rs2 = null;
            String diasem="";
            String arreglo_imagenrespuesta[]=null,arreglo_imagenenvia[]=null;
            texto2="select * from x1_supervision_tareas_catalogo('"+variables_global.getcliente_tistribucion()+"',1,'"+texbuesqueda+"') as (folio integer,fecha_alta_pro timestamp without time zone,docto_agrupar character varying(16),descripcion_tarea text,fecha_a_realizar text,hora_realizar character varying(16),fecha_alta_reali timestamp without time zone,fecha_realizada text,hora_realizada character varying(16),descripcion_ejecuciontarea text,personal_realizo text,imagenes_tarea text,observaciones_tareasrealizadas text,status_tarea smallint,calificacion_tarea smallint,departamento_o_tienda smallint,tipo smallint,prioridad smallint,tipo_descrip character varying(25),status_descrip character varying(25),cali_descrip character varying(25),descripcion_depa character varying(80),prio_descrip character varying(25),deporigen smallint,fotos_origen character varying(255));";
              System.out.println(texto2);
                            try{
                                  rs2 = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                                  while (rs2.next())
                                    {
                                     
                                        this.jtf_asignado.setText(rs2.getString("descripcion_depa"));
                                        this.jtf_prioridad.setText(rs2.getString("prio_descrip"));
                                        this.jtf_fecha.setText(rs2.getString("fecha_a_realizar")+" "+this.DiaSemana(rs2.getString("fecha_a_realizar")));
                                        this.jtf_tipo.setText(rs2.getString("folio")+":"+rs2.getString("tipo_descrip"));
                                        this.jtf_horarealiza.setText(rs2.getString("hora_realizar"));
                                        this.jta_descripcion.setText("<p align=justify>"+rs2.getString("descripcion_tarea")+"</p>");
                                        this.jep_comentarios.setText("<p align=justify>"+rs2.getString("observaciones_tareasrealizadas")+"</p>");
                                        arreglo_imagenenvia=rs2.getString("fotos_origen").split(":");
                                        // System.out.println(rs2.getString("imagenes_tarea")+" "+arreglo_imagenrespuesta.length);
                                             for (int i=0;i<arreglo_imagenenvia.length;i++)
                                                    {
                                                        this.cmbx_fotosorigen.addItem(arreglo_imagenenvia[i]);
                                                    }
                                             if(arreglo_imagenenvia.length >0 )
                                                    {
                                                            this.jep_imagenenvia.setText("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHost()+"/javaweb/super_tareaasigna/"+arreglo_imagenenvia[0]+"\" width=\"350\" height=\"300\" border=\"0\" alt=\"Foto\"></img></p></body></html>");
                                                    }
                                             else
                                                    {
                                                        this.cmbx_fotosorigen.addItem("No existen Imagenes");
                                                    }
                                      if(rs2.getString("fecha_realizada") != null )
                                            {
                                             diasem= this.DiaSemana(rs2.getString("fecha_realizada"));
                                             this.jft_fecharealizada.setText(rs2.getString("fecha_realizada")+" "+diasem+"");
                                             this.jtf_horarealizada.setText(rs2.getString("hora_realizada"));
                                             this.jta_personal.setContentType("text/html");
                                             this.jta_personal.setEditable(false);
                                             this.jta_personal.setText("<p align=justify>"+rs2.getString("personal_realizo")+"</p>");
                                             this.jep_respuestas.setContentType("text/html");
                                             this.jep_respuestas.setEditable(false);
                                             this.jep_respuestas.setText("<p align=justify>"+rs2.getString("descripcion_ejecuciontarea")+"</p>");
                                             arreglo_imagenrespuesta=rs2.getString("imagenes_tarea").split(":");
                                            
                                            // System.out.println(rs2.getString("imagenes_tarea")+" "+arreglo_imagenrespuesta.length);
                                             for (int i=0;i<arreglo_imagenrespuesta.length;i++)
                                                    {
                                                        this.jcmbx_imagenestarea.addItem(arreglo_imagenrespuesta[i]);
                                                    }
                                             if(arreglo_imagenrespuesta.length >0 )
                                                    {
                                                           // this.jep_imagenestrabajo.setText("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://michelleptv.dyndns.org/javaweb/super_tareasrespuesta/"+arreglo_imagenrespuesta[0]+"\" width=\"445\" height=\"365\" border=\"0\" alt=\"Foto\"></img></p></body></html>");
                                                    }
                                             else
                                                    {
                                                        this.jcmbx_imagenestarea.addItem("No existen Imagenes");
                                                    }
                                               } //termina la consulta si ya esta realizada

                                      
                                    this.jtf_calificacion.setText(rs2.getString("cali_descrip"));

                                    if(rs2.getInt("calificacion_tarea") == 0)
                                            {
                                                this.loadcomcalificacion();
                                                
                                            }
                                    else
                                            {
                                             this.jcmbx_calificar.setVisible(false);
                                             this.jlbl_calificar.setVisible(false);

                                            }
                                    if(rs2.getString("status_tarea").equals("3"))
                                            {
                                                this.jbtn_enproceso.setVisible(false);
                                                //this.jbtn_guardar.setVisible(false);
                                            }
                                    this.jtf_grupotareas.setText(rs2.getString("docto_agrupar"));
                                    if(rs2.getString("docto_agrupar") != null )
                                            {
                                                this.loadcomgrupotareas(rs2.getString("docto_agrupar"));
                                            }
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }


                                controlcombo=1;
                                controlcombo_grupo=1;
}
private void cargar_datoscata_t_grupo(String texbuesqueda)
{
     
            String texto="",texto2="";
           
            ResultSet rs2 = null;
            String diasem="";
            String arreglo_imagenrespuesta[]=null,arreglo_imagenenvia[]=null;
            String arreglo_grupo_depa[]=this.jcmbx_otras.getSelectedItem().toString().split(":");

                this.jft_fecharealizada.setText("");
                this.jtf_horarealizada.setText("");
                this.jta_personal.setText("");
                this.jta_comentarios.setText("");


                 texto2="select * from x1_supervision_tareas_catalogo('"+arreglo_grupo_depa[0]+"',2,'"+this.jtf_grupotareas.getText()+"') as (folio integer,fecha_alta_pro timestamp without time zone,docto_agrupar character varying(16),descripcion_tarea text,fecha_a_realizar text,hora_realizar character varying(16),fecha_alta_reali timestamp without time zone,fecha_realizada text,hora_realizada character varying(16),descripcion_ejecuciontarea text,personal_realizo text,imagenes_tarea text,observaciones_tareasrealizadas text,status_tarea smallint,calificacion_tarea smallint,departamento_o_tienda smallint,tipo smallint,prioridad smallint,tipo_descrip character varying(25),status_descrip character varying(25),cali_descrip character varying(25),descripcion_depa character varying(80),prio_descrip character varying(25),deporigen smallint,fotos_origen character varying(50));";

                            System.out.println(texto2);
                            try{
                                  rs2 = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                                  while (rs2.next())
                                    {

                                        ffolio=rs2.getString("folio");
                                        this.jtf_asignado.setText(rs2.getString("descripcion_depa"));
                                        this.jtf_prioridad.setText(rs2.getString("prio_descrip"));
                                        this.jtf_fecha.setText(rs2.getString("fecha_a_realizar")+" "+this.DiaSemana(rs2.getString("fecha_a_realizar")));
                                        this.jtf_tipo.setText(rs2.getString("folio")+":"+rs2.getString("tipo_descrip"));
                                        this.jtf_horarealiza.setText(rs2.getString("hora_realizar"));
                                        this.jta_descripcion.setText("<p align=justify>"+rs2.getString("descripcion_tarea")+"</p>");
                                        this.jep_comentarios.setText("<p align=justify>"+rs2.getString("observaciones_tareasrealizadas")+"</p>");
                                         arreglo_imagenenvia=rs2.getString("fotos_origen").split(":");
                                        // System.out.println(rs2.getString("imagenes_tarea")+" "+arreglo_imagenrespuesta.length);
                                             for (int i=0;i<arreglo_imagenenvia.length;i++)
                                                    {
                                                        this.cmbx_fotosorigen.addItem(arreglo_imagenenvia[i]);
                                                    }
                                             if(arreglo_imagenenvia.length >0 )
                                                    {
                                                            this.jep_imagenenvia.setText("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHost()+"/javaweb/super_tareasasigna/"+arreglo_imagenenvia[0]+"\" width=\"350\" height=\"300\" border=\"0\" alt=\"Foto\"></img></p></body></html>");
                                                    }
                                             else
                                                    {
                                                        this.cmbx_fotosorigen.addItem("No existen Imagenes");
                                                    }
                                      if(rs2.getString("fecha_realizada") != null )
                                            {
                                             diasem= this.DiaSemana(rs2.getString("fecha_realizada"));
                                             this.jft_fecharealizada.setText(rs2.getString("fecha_realizada")+" "+diasem+"");
                                             this.jtf_horarealizada.setText(rs2.getString("hora_realizada"));
                                             this.jta_personal.setContentType("text/html");
                                             this.jta_personal.setEditable(false);
                                             this.jta_personal.setText("<p align=justify>"+rs2.getString("personal_realizo")+"</p>");
                                             this.jep_respuestas.setContentType("text/html");
                                             this.jep_respuestas.setEditable(false);
                                             this.jep_respuestas.setText("<p align=justify>"+rs2.getString("descripcion_ejecuciontarea")+"</p>");
                                             arreglo_imagenrespuesta=rs2.getString("imagenes_tarea").split(":");
                                             System.out.println(rs2.getString("imagenes_tarea")+" "+arreglo_imagenrespuesta.length);
                                             for (int i=0;i<arreglo_imagenrespuesta.length;i++)
                                                    {
                                                        this.jcmbx_imagenestarea.addItem(arreglo_imagenrespuesta[i]);
                                                    }
                                             if(arreglo_imagenrespuesta.length >0 )
                                                    {
                                                           // this.jep_imagenestrabajo.setText("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://michelleptv.dyndns.org/javaweb/super_tareasrespuesta/"+arreglo_imagenrespuesta[0]+"\" width=\"445\" height=\"365\" border=\"0\" alt=\"Foto\"></img></p></body></html>");
                                                    }
                                             else
                                                    {
                                                        this.jcmbx_imagenestarea.addItem("No existen Imagenes");
                                                    }
                                               } //termina la consulta si ya esta realizada

                                      
                                    this.jtf_calificacion.setText(rs2.getString("cali_descrip"));

                                    if(rs2.getInt("calificacion_tarea") == 0)
                                            {
                                                //this.loadcomcalificacion();
                                                
                                            }
                                    else
                                            {
                                             this.jcmbx_calificar.setVisible(false);
                                             this.jlbl_calificar.setVisible(false);

                                            }
                                    if(rs2.getString("status_tarea").equals("3"))
                                            {
                                                this.jbtn_enproceso.setVisible(false);
                                                //this.jbtn_guardar.setVisible(false);
                                            }
                                    
                                    }//consulto la bd
                                }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }


                                controlcombo=1;
}

  private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }

  private void loadcomcalificacion(){
        
          rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_calificacion() as (id smallint,descrip character varying(25));",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                      this.jcmbx_calificar.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
         

         
    }
  private void loadcomgrupotareas(String tarea){

          rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_agrupadas('"+tarea+"') as (id smallint,descrip character varying(25));",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                      this.jcmbx_otras.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }



    }
  /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                supervision_tareas_edita dialog = new supervision_tareas_edita(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cmbx_fotosorigen;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JButton jbtn_agregarcomentario;
    private javax.swing.JButton jbtn_enproceso;
    private javax.swing.JButton jbtn_guardar;
    private javax.swing.JComboBox jcmbx_calificar;
    private javax.swing.JComboBox jcmbx_imagenestarea;
    private javax.swing.JComboBox jcmbx_otras;
    private javax.swing.JEditorPane jep_comentarios;
    private javax.swing.JEditorPane jep_imagenenvia;
    private javax.swing.JEditorPane jep_respuestas;
    private javax.swing.JTextField jft_fecharealizada;
    private javax.swing.JLabel jlbl_calificar;
    private javax.swing.JLabel jlbl_otros;
    private javax.swing.JMenuItem jmni_actualizar;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_guardar;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JEditorPane jta_comentarios;
    private javax.swing.JEditorPane jta_descripcion;
    private javax.swing.JEditorPane jta_personal;
    private javax.swing.JTextField jtf_asignado;
    private javax.swing.JTextField jtf_calificacion;
    private javax.swing.JTextField jtf_fecha;
    private javax.swing.JTextField jtf_grupotareas;
    private javax.swing.JTextField jtf_horarealiza;
    private javax.swing.JTextField jtf_horarealizada;
    private javax.swing.JTextField jtf_prioridad;
    private javax.swing.JTextField jtf_tipo;
    // End of variables declaration//GEN-END:variables

}
